import config from '@/config'
import http from '@/utils/request'

export default {
	list: {
		url: `${config.API_URL}/emp/list`,
		name: '列表',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	listBystaff: {
		url: `${config.API_URL}/emp/listByStaff`,
		name: '列表',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	getScene: {
		url: `${config.API_URL}/emp/getScene`,
		name: '场景部',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	},
	getArea: {
		url: `${config.API_URL}/emp/getArea`,
		name: '片区',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	},
	getCustomerList: {
		url: `${config.API_URL}/emp/getCustomerList`,
		name: '片区',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	getCustomList: {
		url: `${config.API_URL}/emp/getCustomList`,
		name: '查询',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	insertCustom: {
		url: `${config.API_URL}/emp/insertCustom`,
		name: '保存',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	updateEmp: {
		url: `${config.API_URL}/emp/updateEmp`,
		name: '保存',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	// 省市
	getChinaTree: {
		url: `${config.API_URL}/emp/getChinaTree`,
		name: '保存',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	// 通过片区获取省市区
	getChinaTreeByArea: {
		url: `${config.API_URL}/emp/getChinaTreeByArea`,
		name: '通过片区获取省市区',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	},
	// 通过片区列表获取省市区
	getChinaTreeByAreaList: {
		url: `${config.API_URL}/emp/getChinaTreeByAreaList`,
		name: '通过片区列表获取省市区',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},

	// 详情
	getEmpDetails: {
		url: `${config.API_URL}/emp/getEmpDetails`,
		name: '详情',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},

	empMsgList: {
		url: `${config.API_URL}/emp/empMsgList`,
		name: '员工消息列表',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	feedbackList: {
		url: `${config.API_URL}/msg/feedback/list`,
		name: '意见反馈列表',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	},
	feedbackImage: {
		url: `${config.API_URL}/file/getImage`,
		name: '意见反馈图片',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data, { responseType: 'arraybuffer' })
		}
	},
	updateRead: {
		url: `${config.API_URL}/msg/feedback/update`,
		name: '意见反馈已读',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	handleEmpMsg: {
		url: `${config.API_URL}/emp/handleEmpMsg`,
		name: '员工消息设置已读',
		post: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.post(this.url, data)
		}
	},
	noticeExport: {
		url: `${config.API_URL}/msg/feedback/export`,
		name: '意见反馈导出功能',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	},
	// 获取职位
	postList: {
		url: `${config.API_URL}/emp/postList`,
		name: '获取职位',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	},
	// 获取岗位
	posnList: {
		url: `${config.API_URL}/emp/posnList`,
		name: '获取岗位',
		get: async function (data = {}) {
			// eslint-disable-next-line no-return-await
			return await http.get(this.url, data)
		}
	}
}
